package com.bankcomm.peripheral;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 银行卡信息 Bean
 * 
 * @author
 * 
 */
public class BankCardInfoBean implements Parcelable {
	/**
	 * 银行卡卡号
	 */
	public String cardNo;

	/**
	 * 一 磁道信息
	 */
	public String track1Data;

	/**
	 * 二 磁道信息
	 */
	public String track2Data;

	/**
	 * 三磁道信息
	 */
	public String track3Data;
	/**
	 * 实际读取模式，取值范围与ReadBankCardInfo方法中的readMode相同
	 */
	public int readMode;

	/**
	 * 用户姓名
	 */
	public String userName;
	/**
	 * 证件类型
	 */
	public String credentialType;
	/**
	 * 证件号码
	 */
	public String documentNumber;
	/**
	 * 账户余额
	 */
	public String accountBalance;
	/**
	 * 余额上限
	 */
	public String balanceCap;
	/**
	 * 失效日期
	 */
	public String expDate;
	/**
	 * 卡序列号
	 */
	public String serialNumber;
	// add by yu.jicheng
	/**
	 * 五五域
	 */
	public String ictag;
	/**
	 * 五五域长度
	 */
	public String ictagLength;

	// add by yu.jicheng
    /**
     * 卡片类型 0 IC卡 1 磁条卡 2 NFC
     */

    public int cardType;
    
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }

    public void setOneMagneticTrack(String oneMagneticTrack) {
        this.track1Data = oneMagneticTrack;
    }

    public void setTwoMagneticTrack(String twoMagneticTrack) {
        this.track2Data = twoMagneticTrack;
    }

    public void setThreeMagneticTrack(String threeMagneticTrack) {
        this.track2Data = threeMagneticTrack;
    }

    public void setICChipData(String ICChipData) {
        this.ictag = ICChipData;
    }

    public void setCardType(int cardType) {
        this.cardType = cardType;
    }

    public String getCardNo() {
        return cardNo;
    }

    public String getOneMagneticTrack() {
        return track1Data;
    }

    public String getTwoMagneticTrack() {
        return track2Data;
    }

    public String getThreeMagneticTrack() {
        return track3Data;
    }

    public String getICChipData() {
        return ictag;
    }

    public int getCardType() {
        return cardType;
    }

    
    

	@Override
	public int describeContents() {
		return 0;
	}

	public BankCardInfoBean() {

	}

	public BankCardInfoBean(Parcel source) {
		cardNo = source.readString();
		track1Data = source.readString();
		track2Data = source.readString();
		track3Data = source.readString();
		readMode = source.readInt();
		userName = source.readString();
		credentialType = source.readString();
		documentNumber = source.readString();
		accountBalance = source.readString();
		balanceCap = source.readString();
		expDate = source.readString();
		serialNumber = source.readString();
        cardType = source.readInt();

	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(cardNo);
		dest.writeString(track1Data);
		dest.writeString(track2Data);
		dest.writeString(track3Data);
		dest.writeInt(readMode);
		dest.writeString(userName);
		dest.writeString(credentialType);
		dest.writeString(documentNumber);
		dest.writeString(accountBalance);
		dest.writeString(balanceCap);
		dest.writeString(expDate);
		dest.writeString(serialNumber);
        dest.writeInt(cardType);

	}

	public static final Creator<BankCardInfoBean> CREATOR = new Creator<BankCardInfoBean>() {
		public BankCardInfoBean createFromParcel(Parcel source) {
			return new BankCardInfoBean(source);
		}

		public BankCardInfoBean[] newArray(int size) {
			return new BankCardInfoBean[size];
		}
	};

//	@Override
//	public String toString() {
//		return "BankCardInfoBean [cardNo=" + cardNo + ", track1Data="
//				+ track1Data + ", track2Data=" + track2Data + ", track3Data="
//				+ track3Data + ", userName=" + userName + ", readMode="
//				+ readMode + "]";
//	}

	@Override
	public String toString() {
		return "BankCardInfoBean{" +
				"cardNo='" + cardNo + '\'' +
				", track1Data='" + track1Data + '\'' +
				", track2Data='" + track2Data + '\'' +
				", track3Data='" + track3Data + '\'' +
				", readMode=" + readMode +
				", userName='" + userName + '\'' +
				", credentialType='" + credentialType + '\'' +
				", documentNumber='" + documentNumber + '\'' +
				", accountBalance='" + accountBalance + '\'' +
				", balanceCap='" + balanceCap + '\'' +
				", expDate='" + expDate + '\'' +
				", serialNumber='" + serialNumber + '\'' +
				", ictag='" + ictag + '\'' +
				", ictagLength='" + ictagLength + '\'' +
				", cardType=" + cardType +
				'}';
	}
}
